import request from '@/utils/request'

// 创建入库记录
export function createWarehousing(data) {
  return request({
    url: '/ems/warehousing/create',
    method: 'post',
    data: data
  })
}

// 更新入库记录
export function updateWarehousing(data) {
  return request({
    url: '/ems/warehousing/update',
    method: 'put',
    data: data
  })
}

// 删除入库记录
export function deleteWarehousing(id) {
  return request({
    url: '/ems/warehousing/delete?id=' + id,
    method: 'delete'
  })
}

// 获得入库记录
export function getWarehousing(id) {
  return request({
    url: '/ems/warehousing/get?id=' + id,
    method: 'get'
  })
}

// 获得入库记录分页
export function getWarehousingPage(query) {
  return request({
    url: '/ems/warehousing/page',
    method: 'get',
    params: query
  })
}

// 导出入库记录 Excel
export function exportWarehousingExcel(query) {
  return request({
    url: '/ems/warehousing/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 删除入库信息
export function deleteInfo(id) {
  return request({
    url: '/ems/warehousing/deleteInfo?id=' + id,
    method: 'delete'
  })
}


// 批量创建入库记录
export function insertBatchInfo(data) {
  return request({
    url: '/ems/warehousing/insertBatchInfo',
    method: 'post',
    data: data
  })
}

// 更新入库信息
export function updateInfo(data) {
  return request({
    url: '/ems/warehousing/updateInfo',
    method: 'put',
    data: data
  })
}